void halftone_c (
	unsigned char *src,
	unsigned char *dst,
	int m,
	int n,
	int src_row_size,
	int dst_row_size
) {
	//unsigned char (*src_matrix)[src_row_size] = (unsigned char (*)[src_row_size]) src;
	//unsigned char (*dst_matrix)[dst_row_size] = (unsigned char (*)[dst_row_size]) dst;


    int indice_fila = 0;
    int indice_columna = 0;

    while(indice_fila < m - 1) {
        while(indice_columna < n - 1) {
            int suma = 0;
            int a1 = (int) src[indice_fila * src_row_size + indice_columna];
            int a2 = (int) src[indice_fila * src_row_size + indice_columna + 1];
            int a3 = (int) src[(indice_fila + 1) * src_row_size + indice_columna];
            int a4 = (int) src[(indice_fila + 1) * src_row_size + indice_columna + 1];
	    suma += a1 + a2 + a3 + a4;

            unsigned char d1, d2, d3, d4;
            d1 = d2 = d3 = d4 = (unsigned char) 0;
            if (suma < 205) {
            }
            else if (205 <= suma && suma < 410) {
                d1 = (unsigned char) 255;
            }
            else if (410 <= suma && suma < 615) {
                d1 = d4 = (unsigned char) 255;
            }
            else if (615 <= suma && suma < 820) {
                d1 = d3 = d4 = (unsigned char) 255;
            }
            else if (820 <= suma) {
                d1 = d2 = d3 = d4 = (unsigned char) 255;
            }

            dst[indice_fila * dst_row_size + indice_columna] = d1;
            dst[indice_fila * dst_row_size + indice_columna + 1] = d2;
            dst[(indice_fila + 1) * dst_row_size + indice_columna] = d3;
            dst[(indice_fila + 1) * dst_row_size + indice_columna + 1] = d4;

            indice_columna += 2;
        }

        indice_columna = 0;
        indice_fila += 2;
    
    
    }


}
